package com.my.bbs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.my.bbs.dao.MyRoleMapper;
import com.my.bbs.entity.MyRole;
import com.my.bbs.service.MyRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author 86187
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MyRoleServiceImpl implements MyRoleService {

    @Resource
    private MyRoleMapper roleMapper;

    @Override
    public MyRole getCodeById(Long id) {
        QueryWrapper<MyRole> wrapper = new QueryWrapper<>();
        wrapper.eq("id", id);
        return  roleMapper.selectOne(wrapper);
    }
}
